package com.stu.service.impl;

import cn.hutool.core.util.StrUtil;
import com.stu.dao.MajorMapper;
import com.stu.po.Major;
import com.stu.service.MajorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MajorServiceImpl implements MajorService {
    @Autowired
    private MajorMapper majorMapper;

    @Override
    public Integer MajorByName(String majorName, String collegeName) {
        if (StrUtil.isBlank(majorName) || StrUtil.isBlank(collegeName)) {
            return null;
        }
        Integer i = majorMapper.majorByName(majorName, collegeName);
        return i;
    }

    @Override
    public Major majorInfo(Integer majorId, Integer collegeId) {
        return majorMapper.majorInfo(majorId, collegeId);
    }

    @Override
    public List<Major> majorList() {
        return majorMapper.majorList();
    }
}
